﻿using System.Web.Mvc;
using Reece.Open.Mvc.Common;

namespace Reece.Open.Mvc.Two.Extenders
{
    public static class Menus
    {
        public static TopMenu BeginMenu(this HtmlHelper html, string id, string css = "dropmenu", bool renderInit = false )
        {
            return new TopMenu(html.ViewContext,id,css, renderInit);
        }

        public static void FirstMenuItem(this HtmlHelper html, string text, string id, string href = null)
        {
            html.ViewContext.Writer.WriteLine(MenuItems.FirstMenuItem(text, id, href));
        }

        public static void LastMenuItem(this HtmlHelper html, string text, string id, string href = null)
        {
            html.ViewContext.Writer.WriteLine(MenuItems.LastMenuItem(text, id, href));
        }

        public static void MenuItem(this HtmlHelper html, string text, string id, string href = null)
        {
            html.ViewContext.Writer.WriteLine(MenuItems.MenuItem(text,id,href));
        }

        public static SubMenu BeginSubMenu(this HtmlHelper html)
        {
            return new SubMenu(html.ViewContext);
        }
    }
}
